using System.Drawing;
using System.Windows.Forms;
using Nuwanda.TfsSpotlight.Shell.Proxies.Interfaces;

namespace Nuwanda.TfsSpotlight.Shell.Services
{
    internal class CustomToolStripConfigurationExpression : ICustomToolStripConfigurationExpression
    {
        private readonly CommandConfiguration _configuration;
        private readonly IToolStrip _strip;

        public CustomToolStripConfigurationExpression(CommandConfiguration configuration, IToolStrip strip)
        {
            this._configuration = configuration;
            this._strip = strip;
            configuration.ToolStrip = strip;
        }

        public void AddSeparator()
        {
            this._strip.Add(new ToolStripSeparator());
        }

        public ToolStripLabel AddLabel(string text)
        {
            var label = new ToolStripLabel(text);
            this._configuration.SupportingItems.Add(label);
            this._strip.Add(label);
            return label;
        }

        public ToolStripTextBox AddTextBox()
        {
            var textBox = new ToolStripTextBox();
            this._configuration.SupportingItems.Add(textBox);
            this._strip.Add(textBox);
            return textBox;
        }

        public ToolStripSplitButton AddDropDownButton(Image image)
        {
            var dropDown = new ToolStripSplitButton(image);
            this._configuration.SupportingItems.Add(dropDown);
            this._strip.Add(dropDown);
            return dropDown;
        }
    }
}